]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
screenShield: Fix use of null this._dialog
authorMatthew Leeds <matthew.leeds@endlessm.com>
Fri, 24 Apr 2020 00:42:16 +0000 (17:42 -0700)
committerFlorian Müllner <florian.muellner@gmail.com>
Fri, 24 Apr 2020 23:47:31 +0000 (23:47 +0000)
On Fedora 32 if you close the laptop lid during gnome-initial-setup,
gnome-shell hits this error:

JS ERROR: Exception in callback for signal: prepare-for-sleep: TypeError: this._dialog is undefined
_resetLockScreen@resource:///org/gnome/shell/ui/screenShield.js:434:9
activate@resource:///org/gnome/shell/ui/screenShield.js:571:14
lock@resource:///org/gnome/shell/ui/screenShield.js:617:14
_prepareForSleep@resource:///org/gnome/shell/ui/screenShield.js:219:22
_emit@resource:///org/gnome/gjs/modules/core/_signals.js:133:47
_prepareForSleep@resource:///org/gnome/shell/misc/loginManager.js:198:14
_emit@resource:///org/gnome/gjs/modules/core/_signals.js:133:47
_convertToNativeSignal@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:169:19

This is because _ensureUnlockDialog() hit its first early return. So
return early from activate() in that case, so this._dialog doesn't get
used while it's null.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1213

js/ui/screenShield.js

index 98279e070f5c14f1605d968651819bb8d1f8ab8a..ab75577fa98070b48efa2e24c52672fcc14fa516 100644 (file)
@@ -561,7 +561,8 @@ var ScreenShield = class {
         if (this._activationTime == 0)
             this._activationTime = GLib.get_monotonic_time();
 
-        this._ensureUnlockDialog(true);
+        if (!this._ensureUnlockDialog(true))
+            return;
 
         this.actor.show();